package com.example.dqreptile.service.impl;

import com.example.dqreptile.dao.IMonsterRepository;
import com.example.dqreptile.entity.Monster;
import com.example.dqreptile.service.IMonsterService;
import org.hibernate.sql.Insert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class IMonsterServiceImpl implements IMonsterService {


    @Autowired
    private IMonsterRepository iMonsterRepository;

    @Override
    public Monster save(Monster monster) {
        return this.iMonsterRepository.save(monster);
    }

    @Override
    public Monster findOne(int mId) {
        return this.iMonsterRepository.findById(mId).orElse(null);
    }


}
